﻿using WebApiClientCore;
using WebApiClientCore.Attributes;

namespace Ongoal.Quotation.WebApi
{
    /// <summary>
    /// API 请求接口
    /// </summary>
   public interface IWebApiRequest
    {
        /// <summary>
        /// GET
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        public ITask<string> Get([Uri] string url, object input);

        /// <summary>
        /// POST
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public ITask<string> Post([Uri] string url, [JsonContent] object input);

        /// <summary>
        /// PUT
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPut]
        public ITask<string> Put([Uri] string url, object input);

        /// <summary>
        /// DELETE
        /// </summary>
        /// <param name="url"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpDelete]
        public ITask<string> Delete([Uri] string url, object input);

        /// <summary>
        /// PATCH
        /// </summary>
        /// <param name="url"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPatch]
        public ITask<string> Patch([Uri] string url, object input);
    }
}
